x86/efi: move the logic to detect PE build support
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 8 Oct 2018 12:26:28 +0000 (14:26 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 8 Oct 2018 12:26:28 +0000 (14:26 +0200)
commitb1a47ef0632b12149637410c74d7e1504d9d48bc
tree8dd0ea8192760a5379e2993c7ad456f6c6d67306
parent5b1592d188d3f33eed65167dbff93bba1cb8d8c7
x86/efi: move the logic to detect PE build support

So that it can be used by other components apart from the efi specific
code. By moving the detection code creating a dummy efi/disabled file
can be avoided.

This is required so that the conditional used to define the efi symbol
in the linker script can be removed and instead the definition of the
efi symbol can be guarded using the preprocessor.

The motivation behind this change is to be able to build Xen using lld
(the LLVM linker), that at least on version 6.0.0 doesn't work
properly with a DEFINED being used in a conditional expression:

ld    -melf_x86_64_fbsd  -T xen.lds -N prelink.o --build-id=sha1 \
    /root/src/xen/xen/common/symbols-dummy.o -o /root/src/xen/xen/.xen-syms.0
ld: error: xen.lds:233: symbol not found: efi

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Daniel Kiper <daniel.kiper@oracle.com>
master commit: 18cd4997d26b9df95dda87503e41c823279a07a0
master date: 2018-07-31 10:24:22 +0200
.gitignore
xen/arch/x86/Makefile
xen/arch/x86/efi/Makefile
xen/arch/x86/xen.lds.S